<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');
?>


<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我发布的文章-众晒网</title>
    <link rel="stylesheet" type="text/css" href="/ui/css/Hui.css" />
    <style type="text/css">
    .H-theme-background-color9 {
    background-color: #ffffff;
}
.H-theme-font-color-white {
    color: black;
}
.H-theme-border-color9 {
    border: 1px solid #ffa200;
}
.H-theme-font-color9 {
    color: #ffa200;
}
    button {
    background: #cccccc00;
    border-radius: 7px;
    border: 1px solid #828282;
    margin: 11px;
    font-size: 12px;
    width: 55px;
}
:focus {
    border-color: #ffa200;
    border-radius: 5px;
    outline: none;
    color:  #ffa200;
}
    </style>
</head>
<body id="body">
    <header class="H-header H-theme-background-color9" id="header">
        <span tapmode="" onclick="H.closeWin();" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color-white H-padding-horizontal-left-5 H-z-index-100"><i class="H-iconfont H-icon-arrow-left H-font-size-18 H-vertical-middle"></i><label class="H-display-block H-vertical-middle H-font-size-15">返回</label></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-white H-position-absolute H-width-100-percent">
           我的文章
        </div>
        <div class="H-flexbox-horizontal H-theme-background-color-white" id="tag">
            <div tapmode="" onclick="H.openWin('myphoto', 'myphoto.php');" class="H-flex-item H-center-all H-theme-font-color-666 H-padding-vertical-both-10 H-theme-border-color-white  H-font-size-16 H-theme-border-color-52ace5 H-theme-font-color-52ace5 H-theme-border-color9 H-theme-font-color9" style="border-width: 0 0 2px  0">
                照片
            </div>
            <div tapmode="" onclick="H.openWin('myarticle', 'myarticle.php');"  class="H-flex-item H-center-all H-theme-font-color-666 H-padding-vertical-both-10 H-theme-border-color-white  H-font-size-16" style="border-width: 0 0 2px  0">
                攻略
            </div>
           
        </div>
    </header>
	
	
    <div id="lis" class="H-padding-8">
	
	  <?php

  	$reslut = "select count(*) as a from tbl_mother_article where  status=0 and type=2 and uid='".$_COOKIE['userid']."'";
  $query_reslut = mysql_query($reslut);
$row_reslut=mysql_fetch_array($query_reslut);
$count=$row_reslut['a'];
//页面数量
$page_size=10;
//总页数
$page_count = ceil($count/$page_size);
//第几页
$page=$_GET['page'];
if($page==''){
  $page=1;
}
$last=$page-1;//上一页
$next=$page+1;//下一页

//页面起始条数
$offset=$page_size*($page-1);
  
  
  
           $sql1 = "select * from tbl_mother_article where  status=0 and type=2 and uid='".$_COOKIE['userid']."' order by id desc LIMIT $offset,$page_size";
           $query1 = mysql_query($sql1);
		
        if(!mysql_affected_rows()){
            echo '
                <div class="H-padding-vertical-bottom-10"></div>
                </br>
    <div class="H-channel-title H-flexbox-horizontal H-theme-background-color-white H-vertical-middle H-border-vertical-bottom-after">
        <div class="H-channel-line H-theme-background-color8 H-padding-vertical-top-15 H-padding-horizontal-left-3  H-margin-horizontal-left-10"></div>
        <div class="H-channel-text H-theme-font-color8 H-flex-item H-font-size-18 H-theme-font-color-black H-padding-10 H-margin-horizontal-right-10 H-text-show-row-1">空空如也</div>
    </div>
    </br></br>
            ';
}        
        while ($row=mysql_fetch_array($query1)) {
			
       $reslut2 = "select * from tbl_mother_catgroy where id='".$row['cat_id']."'";
       $query_reslut2 = mysql_query($reslut2);
       $row_reslut2=mysql_fetch_array($query_reslut2);   
    ?>
        <div id="list1" class="H-border-radius3-px H-theme-background-color-white H-margin-vertical-bottom-5 H-border-vertical-both-after H-border-horizontal-both-after">
            
            <div  class="H-flexbox-horizontal H-theme-background-color-white H-border-vertical-bottom-after">
                <div onclick="location='miquanshow.php?id=<?=$row['id']?>'" class="H-padding-vertical-both-10">
				
					<?php
					
					
						$imgeve =explode(",", $row['show_pic']);
						
						$ss = $row['pic_arr'];  
                        $sy=json_decode($ss, true);
						
						
					
					?>
                    <img src="<?=$sy[0]['pic_url']?>" srcs="" alt="" title="" class="imgCache H-display-block H-margin-horizontal-left-10" style="width: 60px; height: 60px;" />
					

					
				
                </div>
                <div class="H-flex-item H-padding-10">
                    <strong onclick="location='miquanshow.php?id=<?=$row['id']?>'" class="H-font-weight-normal font-weight-500 H-font-size-16 H-display-block H-text-show-row-1"><?=$row['title']?></strong>
                    <div onclick="location='miquanshow.php?id=<?=$row['id']?>'" class="H-font-size-12 H-theme-font-color-999 H-text-show-row-1">
                 <?=$row_reslut2['name']?>
                    </div>
                    <div style="height: 45px;">
					<!----------------
                <button style="float: left;"></button>
				---------------------->
               <div style="float: right;">
                    
                    <button onclick="del(<?=$row['id']?>)">删除</button>
                </div>    
             </div>
                </div>
           
            </div>
            
             
             
        </div>

       		<?php } ?> 
			
	            <?php

    if($page==1){   
	if($page_count>$page){
		
	echo "<a href='?page=".$next."'  style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;margin-left:43%;font-weight: 600;font-size: 14px;'>下一页</a>&nbsp;&nbsp;&nbsp;";	
	
	}
   }else
    if($page==$page_count){
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;  font-size:15px; color: #fc8b4a; margin-left:40%;'>上一页</a>&nbsp;&nbsp;&nbsp;";
    }else{
      echo "&nbsp;&nbsp;<a href='?page=".$last."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;margin-left:30%;font-weight: 600;font-size: 14px;'>上一页</a>&nbsp;&nbsp;&nbsp;";
      echo "<a href='?page=".$next."' style='text-decoration:none; width: 47px;border: 1px solid;border-radius: 5px; border-style: -6px; padding: 5px;color: #fc8b4a;font-weight: 600;font-size: 14px;'>下一页</a>&nbsp;&nbsp;&nbsp;"; 
    }
  ?>		
			
			
			
			
    </div>
	
	
	
	<script type="text/javascript" src="/ui/xianzhi/js/jquery.min.js"></script>
    <script type="text/javascript" src="/ui/script/H.js"></script>
    <script type="text/javascript" src="/ui/layer/mobile/layer.js"></script>  
  	<script>
	function del(a){
		var id=a;
		var uid='<?=$_COOKIE['userid']?>';
	        $.ajax({
            url:'/api/muyin/api.php?s=mother.delete_mother_article',
            type:'POST',
            data:{
				uid:uid,
			id:id	
			},
            success:function(data){
            		    layer.open({
    content: '删除成功!'
    ,skin: 'msg'
    ,time: 2 
  }); 
       setTimeout(close,1100);
	   

            },
            error:function(){

            }
        });		
		
	}
	
	
	</script>
   <script>
  
  function close(){
	  
	location.reload();  
  }
  </script>
  
</body>
</html>